// @ts-ignore

/* eslint-disable */
import { request } from "umi";
/** 获取当前的用户 GET /api/currentUser */

// 列表
export async function getList(params, options) {
  return request("/baseApi/collectiondataresource/datasourcelistdata", {
    method: "GET",
    params: { ...params },
    ...(options || {}),
  });
}

// 详情
export async function getDetail(params, options) {
  return request("/baseApi/collectiondataresource/getdataSourcebyid", {
    method: "GET",
    params: { ...params },
    ...(options || {}),
  });
}

// 增加
export async function addField(body, options) {
  return request("/baseApi/collectiondataresource/addOrUpdateResoure", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

export async function upadataField(body, options) {
  return request("/baseApi/collectiondataresource/addOrUpdateResoure", {
    method: "PUT",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除  */

export async function removeField(options) {
  return request(`/baseApi/collectiondataresource/delete/${options}`, {
    method: "DELETE",
  });
}

// 类别列表
export async function getTree(params, options) {
  return request("/baseApi/collectioncatalogue/getDataCatalogueList", {
    method: "GET",
    params: { ...params },
    ...(options || {}),
  });
}
